import React from 'react'
import PropTypes from 'prop-types';

export default function Props2(props) {
  // console.log(props);
  let {name, age, gender} = props;
  return (
    <ul>
      <li>姓名: {name}</li>
      <li>年龄: {age}</li>
      <li>性别: {gender}</li>
    </ul>
  )
}

// 限制 props 属性值的类型
Props2.propTypes = {
  name: PropTypes.string,
  age: PropTypes.number,
  gender: PropTypes.string
}

Props2.defaultProps = {
  name: '张三'
}

